#include<iostream>
using namespace std;
class demo{
	int id;
	public:
	demo(int i){
		id=i;
		cout<<"id="<<id<<"constructor"<<endl;
	}
	~demo(){
		cout<<"id="<<id<<"constructor"<<endl;
	}
};
	void func(){
		static demo d2(2);
		demo d3(3);
		cout<<"func"<<endl;
	}
int main(){
	demo d4(4);
	d4=6;
	cout<<"main"<<endl;
	{
		demo d5(5);
	}
	func();
	cout<<"main ends"<<endl;

return 0;
}
